package com.xianggu.demo.mapper;

import com.xianggu.demo.dto.UserDto;
import com.xianggu.mybatis.annotation.*;

import java.util.List;

/**
 * @author chengjy
 * @date 2025/3/5
 */
@Mapper
public interface UserMapper {

    @Select("select * from els_subaccount_info where realname = #{realname}")
    public List<UserDto> selectByName(@Param("realname") String realname);


    @Select("select * from els_subaccount_info where id = #{id} ")
    public UserDto getById(@Param("id") String id);

    @Select("select realname from els_subaccount_info where id = #{id} ")
    public String getByUserName(@Param("id") String id);

    @Insert("insert into els_subaccount_info (id , els_account , sub_account ,realname ) value (#{id} , #{elsAccount} , #{subAccount} , #{realname} )")
    public Integer insert(UserDto userDto );
    @Delete("DELETE FROM els_subaccount_info WHERE id =  #{id} ")
    public Integer deleteById(@Param("id") String id );
}
